import '../../style/resource.less';
import React, {
  Component
} from 'react'
import {
  observer
} from 'mobx-react';
import {
  RouteLayout
} from 'weaver-mobile-page';
const ButtonGroup = RouteLayout.ButtonGroup;

@observer
export default class ButtonBar extends Component {
  render() {
    const {
      datas,
      pageLoading,
    } = this.props.store;


    if (datas.bgData) {
      datas.bgData.forEach(data => {
        Object.assign(data, {
          title: data.text
        })
      })
    }

    return (
      <div className='btnBar'>
           {datas.bgData && !pageLoading && <ButtonGroup data={datas.bgData} flexStyle={{style: {flex: 1}}} isButton={false} />}
        </div>
    )
  }
}